<center>
<h1>Información del proyecto</h1><br/>
<table  width="70%">
  <tr>
    <td class="inColumn">
      <%= h "Nombre del proyecto" %></b>
    </td>
    <td>
      <%=h @project.name %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= h "Description"%>
    </td>
    <td>
      <%=h @project.description %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= h "Encargado del proyecto"%>
    </td>
    <td>
      <%=h @project.user.complete_name %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= h "Estatus"%>
    </td>
    <td>
      <%=h @project.status %>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= h "Fecha de inicio"%>
    </td>
    <td>
      <%=h @project.startDate.strftime("%d-%m-%Y")%>
    </td>
  </tr>
  <tr>
    <td class="inColumn">
      <%= h "Fecha de cierre"%>
    </td>
    <td>
      <%=h @project.endDate.strftime("%d-%m-%Y") %>
    </td>
  </tr>
</table>
<br/>
<h3>Tareas</h3><br/>
<center>
<form action="/tasks/edit">
  <table width="80%">
    <tr style="background-color: #f0f0f0">
      <% if current_user.role.id!=3 %>
      <th width="5%">Selec.</th>
      <%end%>
      <th width="20%">Nombre</th>
      <th width="15%">Fecha de inicio</th>
      <th width="15%">Fecha de fin</th>
      <th width="25%">Asignado a</th>
      <th width="20%">Estatus</th>
    </tr>
    
    <%
    f=false
    @tasks.each do |task|
    %>
     <%if task.user.id==current_user.id || current_user.role.id!=3%>
      <tr>
        <% if current_user.role.id !=3 %>
          <td align="center"><input type="radio" id="id" name="id" value="<%= task.id -%>" onClick="document.getElementById('editTask').innerHTML='&nbsp;&nbsp;&nbsp;&nbsp;=><a href=\'/tasks/edit/<%=  task.id %>\'>Editar Tarea</a>';"/> </td>
        <%end%>
        <td align="center"><a href="/tasks/<%= task.id %>"><%= task.name %></a></td>
        <td align="center"><%= task.start_date.strftime("%d-%m-%Y") %></td>
        <td align="center"><%= task.end_date.strftime("%d-%m-%Y")  %></td>
        <td align="center"><%= task.user.complete_name %></td>
        <td align="center"> <%= task.status %></td>
      </tr>
     <%end%>
    <%end%>
  </table>
</form>
  
</center>
<br/><br/>
<%if current_user.role_id<3 && (@project.user_id==current_user.id || current_user.role_id==1)%>
  <%= link_to 'Editar Proyecto', edit_project_path(@project) %> |
<%end%>
<%= link_to 'Regresar', projects_path %>
<br/><br/>
<script>
  try{
  <%  if current_user.role.id==3 %>
    Effect.toggle('subTasks','slide',{duration:0.0});
  <%  end %>
    Effect.toggle('subUsers','slide',{duration:0.0});
    alert(getElementById('id'));
  }catch(e){

  }
</script>

</center>